﻿using BCEntity.Common.SystemExceptionRecord;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.Common.SystemExceptionRecord
{
    /// <summary>
    /// 系统异常记录
    /// </summary>
    public interface ISystemExceptionRecordData
    {
        /// <summary>
        /// 写入系统异常记录
        /// </summary>
        /// <param name="entity"></param>
        void Create(SystemExceptionRecordEntity entity);
        /// <summary>
        /// 获取系统异常记录
        /// </summary>
        /// <param name="name">异常名称</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        Task<(IEnumerable<SystemExceptionRecordEntity>, int)> GetSystemExceptionRecords(string name, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
    }
}
